<?php
class Sites extends Admin_Controller
{
	public function __construct()
	{
		parent::__construct();
	}
	
	public function index()
	{
		$this->template->build('index');
	}
	
	public function download()
	{
		$this->load->dbutil();	
		$prefs = array(
                'format'      => 'zip',             
                'filename'    => 'backup.sql',    
                'add_drop'    => TRUE,             
                'add_insert'  => TRUE,             
                'newline'     => "\n"               
              );
		$backup = $this->dbutil->backup($prefs); 	
		$this->load->helper('download');
		force_download('backup-'.date('Y-m-d_H-i-s').'.zip', $backup);
	}
}